/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package cn.eclass.bean;

import cn.eclass.bean.api.IAdminBean;
import cn.eclass.dao.AdminDao;
import cn.eclass.entity.AdminEntity;
import java.util.List;

/**
 *
 * @author Administrator
 */
public class AdminBean implements IAdminBean {

    private AdminDao dao = new AdminDao();

    @Override
    public AdminEntity add(AdminEntity admin) {
        int newId = dao.add(admin);
        admin.setId(newId);
        return admin;
    }

    @Override
    public boolean checkLoggedin() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean update(AdminEntity user) {
        return dao.update(user);
    }

    @Override
    public boolean delete(int id) {
        return dao.delete(id);
    }

    @Override
    public AdminEntity login(String userName, String psw) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean logout() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public AdminEntity get(int id) {
        return dao.get(id);
    }

    @Override
    public List<AdminEntity> list() {
        return dao.list();
    }
}
